﻿@namespace Masa.Tsc.Web.Admin.Rcl.Components
@inherits TscEChartBase

<MCard Width="Width" Height="Height" Class="d-flex flex-column rounded-lg">
    <MCardTitle Class="d-flex justify-space-between">
        <MLabel Class="emphasis2--text h6">@Title</MLabel>
        <MTooltip Top>
            <ActivatorContent>
                <SIcon @attributes="@context.Attrs">mdi-information-outline</SIcon>
            </ActivatorContent>
            <ChildContent>
                @I18n.Team("For HTTP, gRPC, RPC services, this means Calls Per Minute (calls/min)")
            </ChildContent>
        </MTooltip>
    </MCardTitle>
    <MCardText Class="flex-grow-1">
        @if (_isLoading)
        {
            <LoadingData />
        }
        else if (_data?.Any(item => item?.Result?.Any() is true) is false)
        {
            <NoData />
        }
        else
        {
            <MECharts Option="_options.Option" Width="@("100%")" Height="@("100%")"></MECharts>
        }
    </MCardText>
</MCard>